feat(forms): implement embeddable rendering for Fields question type - #1235
Open
alisher372 wants to merge 1 commit into
Open
feat(forms): implement embeddable rendering for Fields question type#1235alisher372 wants to merge 1 commit into
alisher372 wants to merge 1 commit into
Conversation
## Summary Implement the new embeddable question type interface for the Fields question type. This allows the Fields question type to be rendered inside composite question types while keeping all rendering logic inside the Fields plugin. ## What is implemented - implementation of the new embeddable interface; - embedded administration rendering; - embedded end-user rendering; - automatic block detection; - selection of the concrete field only; - reuse of the existing Fields rendering logic; - full compatibility with existing standalone Fields questions. ## Motivation The Fields plugin already contains all rendering logic required to display its controls. Instead of duplicating this logic in other plugins, it is now exposed through the common interface introduced in GLPI. This keeps responsibilities separated: - Fields knows how to render Fields controls; - composite question types only request rendering. ## Backward compatibility No existing behaviour is changed. Standalone Fields questions continue to work exactly as before. ## Related Depends on: - GLPI Core PR: <link> Used by: - Advanced Forms PR: <link>
This was referenced Aug 1, 2026
alisher372
added a commit
to alisher372/advancedforms
that referenced
this pull request
Aug 2, 2026
## Summary Add support for embeddable question types inside table question columns. Instead of knowing about specific plugins, the table question now delegates rendering to any question type implementing the new embeddable interface. ## What is implemented - support for embeddable question types; - dynamic column configuration loading; - embedded administration rendering; - embedded end-user rendering; - server-side rendering for dynamically added table rows; - validation and preparation of embedded question extra data. ## Why server-side row rendering? Originally, additional table rows were created entirely in JavaScript. This approach worked for built-in question types because their client-side configuration was sufficient to recreate the controls. With embeddable question types, this is no longer enough. Embedded question types are responsible for rendering and initializing their own controls, which may include server-generated markup, unique identifiers and initialization logic. To keep this responsibility inside each question type and avoid duplicating rendering logic in JavaScript, newly added rows are now rendered on demand by the server through a dedicated controller. The controller simply exposes the existing row rendering logic already used for the initial table rendering, ensuring that dynamically added rows behave exactly like the initially rendered ones. ## Motivation The table question previously only supported built-in question types. With this change, any question type implementing the embeddable interface can be used inside a table without introducing plugin-specific rendering logic into Advanced Forms. ## Backward compatibility Existing built-in question types continue to work exactly as before. Plugins that do not implement the embeddable interface are unaffected. ## Related Depends on: - GLPI Core PR: glpi-project/glpi#25065 Example implementation: - Fields PR: pluginsGLPI/fields#1235
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement the new embeddable question type interface for the Fields question type.
This allows the Fields question type to be rendered inside composite question types while keeping all rendering logic inside the Fields plugin.
What is implemented
Motivation
The Fields plugin already contains all rendering logic required to display its controls.
Instead of duplicating this logic in other plugins, it is now exposed through the common interface introduced in GLPI.
This keeps responsibilities separated:
Backward compatibility
No existing behaviour is changed.
Standalone Fields questions continue to work exactly as before.
Related
Depends on:
Used by: